package com.bw.controller;

import com.bw.bean.F1;
import com.bw.service.FoodService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class FoodController {
    @Autowired
    FoodService foodService;
    @RequestMapping("list1")
    public Map list1(){
        List<F1> list1 = foodService.list1();
        return SugarUtil.getPieData(list1);
    }

    @RequestMapping("list2")
    public Map list2(){
        Integer list2 = foodService.list2();
        return SugarUtil.getFlipNumberData(list2);
    }

    @RequestMapping("list3")
    public Map list3(){
        List<F1> list3 = foodService.list3();
        return SugarUtil.getPieData(list3);
    }

    @RequestMapping("list4")
    public Map list4(){
        List<F1> list4 = foodService.list4();
        return SugarUtil.getMapData(list4);
    }
}
